package tx.bj12320.model;

import javax.persistence.*;

import org.hibernate.annotations.GenericGenerator;

import javax.validation.constraints.*;
import org.hibernate.validator.constraints.*;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;

import java.util.*;

import javacommon.base.*;
import javacommon.util.*;

import cn.org.rapid_framework.util.*;
import cn.org.rapid_framework.web.util.*;
import cn.org.rapid_framework.page.*;
import cn.org.rapid_framework.page.impl.*;

import tx.bj12320.model.*;
import tx.bj12320.dao.*;
import tx.bj12320.service.*;
import tx.bj12320.vo.query.*;


@Entity
@Table(name = "BJ12320_WORK_ORDER_QC_RECORD")
public class WorkOrderQcRecord extends BaseEntity implements java.io.Serializable{
	private static final long serialVersionUID = 5454155825314635342L;

	//alias
	public static final String TABLE_ALIAS = "WorkOrderQcRecord";
	public static final String ALIAS_WORK_ORDER_QC_RECORD_ID = "workOrderQcRecordId";
	public static final String ALIAS_TSZB_PROCESS_INFO_ID = "tszbProcessInfoId";
	public static final String ALIAS_PROJECT_APPRAISAL = "projectAppraisal";
	public static final String ALIAS_ASSESSMENT_CONTENT = "assessmentContent";
	public static final String ALIAS_ERROR_PROPERTIES = "errorProperties";
	public static final String ALIAS_DECISION_OUTCOME = "decisionOutcome";
	public static final String ALIAS_REMARKS = "remarks";

	//date formats


	//可以直接使用: @Length(max=50,message="用户名长度不能大于50")显示错误消息
	//columns START
    /**
     * workOrderQcRecordId       db_column: WORK_ORDER_QC_RECORD_ID
     */

	private Long workOrderQcRecordId;
    /**
     * tszbProcessInfoId       db_column: TSZB_PROCESS_INFO_ID
     */

	private Long tszbProcessInfoId;
    /**
     * projectAppraisal       db_column: PROJECT_APPRAISAL
     */
	@Length(max=500)
	private java.lang.String projectAppraisal;
    /**
     * assessmentContent       db_column: ASSESSMENT_CONTENT
     */
	@Length(max=500)
	private java.lang.String assessmentContent;
    /**
     * errorProperties       db_column: ERROR_PROPERTIES
     */
	@Length(max=500)
	private java.lang.String errorProperties;
    /**
     * decisionOutcome       db_column: DECISION_OUTCOME
     */
	@Length(max=500)
	private java.lang.String decisionOutcome;
    /**
     * remarks       db_column: REMARKS
     */
	@Length(max=2000)
	private java.lang.String remarks;
	//columns END


	public WorkOrderQcRecord(){
	}

	public WorkOrderQcRecord(
		Long workOrderQcRecordId
	){
		this.workOrderQcRecordId = workOrderQcRecordId;
	}



	public void setWorkOrderQcRecordId(Long value) {
		this.workOrderQcRecordId = value;
	}

	@Id	@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="BJ12320_WO_QC_RECORD_SEQU")
    @SequenceGenerator(name="BJ12320_WO_QC_RECORD_SEQU",allocationSize=1,initialValue=1, sequenceName="BJ12320_WO_QC_RECORD_SEQU")
	@Column(name = "WORK_ORDER_QC_RECORD_ID", unique = true, nullable = false, insertable = true, updatable = true, length = 0)
	public Long getWorkOrderQcRecordId() {
		return this.workOrderQcRecordId;
	}

	@Column(name = "TSZB_PROCESS_INFO_ID", unique = false, nullable = true, insertable = true, updatable = true, length = 0)
	public Long getTszbProcessInfoId() {
		return this.tszbProcessInfoId;
	}

	public void setTszbProcessInfoId(Long value) {
		this.tszbProcessInfoId = value;
	}

	@Column(name = "PROJECT_APPRAISAL", unique = false, nullable = true, insertable = true, updatable = true, length = 500)
	public java.lang.String getProjectAppraisal() {
		return this.projectAppraisal;
	}

	public void setProjectAppraisal(java.lang.String value) {
		this.projectAppraisal = value;
	}

	@Column(name = "ASSESSMENT_CONTENT", unique = false, nullable = true, insertable = true, updatable = true, length = 500)
	public java.lang.String getAssessmentContent() {
		return this.assessmentContent;
	}

	public void setAssessmentContent(java.lang.String value) {
		this.assessmentContent = value;
	}

	@Column(name = "ERROR_PROPERTIES", unique = false, nullable = true, insertable = true, updatable = true, length = 500)
	public java.lang.String getErrorProperties() {
		return this.errorProperties;
	}

	public void setErrorProperties(java.lang.String value) {
		this.errorProperties = value;
	}

	@Column(name = "DECISION_OUTCOME", unique = false, nullable = true, insertable = true, updatable = true, length = 500)
	public java.lang.String getDecisionOutcome() {
		return this.decisionOutcome;
	}

	public void setDecisionOutcome(java.lang.String value) {
		this.decisionOutcome = value;
	}

	@Column(name = "REMARKS", unique = false, nullable = true, insertable = true, updatable = true, length = 2000)
	public java.lang.String getRemarks() {
		return this.remarks;
	}

	public void setRemarks(java.lang.String value) {
		this.remarks = value;
	}


	private TszbProcessInfo tszbProcessInfo;
	public void setTszbProcessInfo(TszbProcessInfo tszbProcessInfo){
		this.tszbProcessInfo = tszbProcessInfo;
	}

	@ManyToOne(cascade = {}, fetch = FetchType.LAZY)
	@JoinColumns({
		@JoinColumn(name = "TSZB_PROCESS_INFO_ID",nullable = false, insertable = false, updatable = false)
	})
	public TszbProcessInfo getTszbProcessInfo() {
		return tszbProcessInfo;
	}

	public String toString() {
		return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
			.append("WorkOrderQcRecordId",getWorkOrderQcRecordId())
			.append("TszbProcessInfoId",getTszbProcessInfoId())
			.append("ProjectAppraisal",getProjectAppraisal())
			.append("AssessmentContent",getAssessmentContent())
			.append("ErrorProperties",getErrorProperties())
			.append("DecisionOutcome",getDecisionOutcome())
			.append("Remarks",getRemarks())
			.toString();
	}

	public int hashCode() {
		return new HashCodeBuilder()
			.append(getWorkOrderQcRecordId())
			.toHashCode();
	}

	public boolean equals(Object obj) {
		if(obj instanceof WorkOrderQcRecord == false) return false;
		if(this == obj) return true;
		WorkOrderQcRecord other = (WorkOrderQcRecord)obj;
		return new EqualsBuilder()
			.append(getWorkOrderQcRecordId(),other.getWorkOrderQcRecordId())
			.isEquals();
	}
}

